/**
* @Description: WoShop商城
* @Author: 梧桐
* @Copyright: 武汉一一零七科技有限公司©版权所有
* @Link: www.wo-shop.net
* @Contact: QQ:2487937004
*/
<!-- 我的评价 -->
<template>
  <view class="page">
    <view class="comment-item" v-if="list" v-for="(value,index) in list" :key="index">
      <view class="goodsNum">{{$t('订单编号')}}:{{value.ordernumber}}</view>
      <view class="goodsBox">
        <image :src="value.thumb_url" class="goodsAvatar"></image>
        <view class="goodsInfo">
          <view class="goodsName">{{value.goods_name}}</view>
		  <view class="goodsNum">{{$t('提货人')}}:{{value.contacts}}</view>
		  <view class="goodsNum">{{$t('电话')}}:{{value.telephone}}</view>
		  <view class="goodsNum">{{$t('核销时间')}}:{{value.check_time}}</view>
        </view>
      </view>
    </view>
    <loadMore :loadingType="loadingType"></loadMore>
  </view>
</template>
<script>
export default {
  components: {
  },
  data() {
    return {
      shop_id: '',
      list: [],
      page: 1,
      loadingType: 0,
    }
  },
  onLoad() {
    let params = {
      size: "10",
      page: 1,
    };
    this.checkOrderRecord(params);
  },
  onReachBottom() {
    let params = {
      size: "5",
      page: 1,
    };
    this.loadMoreFunc(params);
  },
  onPullDownRefresh() {
    this.page = 1
    this.$nextTick(() => {
      this.checkOrderRecord({
        size: "10",
        page: 1,
      }, true);
    })
    
  },
  methods: {
    
    
    checkOrderRecord(data, refresh) {
      if (this.page == 1) {
        // this.$loading();
      }
      this.$http.checkOrderRecord(data).then(res => {
        if (res.status === 200) {
          // this.$hideLoading();
          if (refresh) {
            this.list = res.data;
            this.loadingType = 0;
            return false
          }
          if (res.data.length == 0) {
            
            this.loadingType = 2;
            return false;
          }
          this.list = this.list.concat(res.data);
          console.log(this.list);
          this.loadingType = 0;
        }
      }).catch(() => {
      })
    },
    
    
    loadMoreFunc: function(params) {
      // 加载函数
      if (this.loadingType == 1 || this.loadingType == 2) {
        return false;
      }
      this.loadingType = 1;

      ++this.page;
      params.page = this.page;
      
      this.$nextTick(() => {
        this.checkOrderRecord(params);
      })
    },
  }
};
</script>

<style lang="less" scoped>
@import "../../static/css/minmix.less";
@import "../../static/css/common.less";
page {
  background: #f4f4f4;
}

.comment-item {
  .panel();
  position: relative;
  margin: 30upx;
  border-radius: 30upx;
  
  .goodsNum {
    color: #999999;
  }
  
  .goodsWords {
    word-break: break-word;
  }
  
  .imageWrap {
    .flex(@justify: flex-start);
    margin-top: 20upx;
  }
  
  .scoll-items {
    width: 120upx;
    height: 120upx;
    border-radius: 4upx;
    margin-right: 10upx;
    border-color: #f5f5f5;
    border-width: 1upx;
    border-style: solid;
  }
  
  .delBtn {
    position: absolute;
    top: 30upx;
    right: 30upx;
    width: 32upx;
    height: 32upx;
    
    image {
      width: 32upx;
      height: 32upx;
    }
  }
  .check_text{
    position: absolute;
    top: 30upx;
    right: 30upx;
    // width: 32upx;
    height: 32upx;
    color: #999999;
  }
}
.goodsBox {
  padding: 18upx 0;
  display: flex;
  justify-content: flex-start;
}
.goodsAvatar {
  width: 142upx !important;
  height: 142upx !important;
  border-radius: 14upx;
  flex-shrink: 0;
}
.goodsInfo {
  padding-left: 14upx;
}
.countStar {
  display: flex;
  position: relative;
}
.goodsName {
  margin-top: 10upx;
  margin-bottom: 10upx;
  font-size: 28upx;
}
.unirate{
  position: relative;
  top: 24upx;
}
</style>
